<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/thickbox.js"></script>
	<link rel="stylesheet" href="css/thickbox.css" type="text/css" media="screen" />
        <title>Feature iTunes Test</title>
    </head>
    <body>
<br><br>
<?php

include('function.php');

$itune_url = "http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsLookup?id=390422167";
$response = file_get_contents($itune_url);
$obj = utf8_decode($response);
$results = json_decode($obj);

$new_url = $results->results[0]->collectionViewUrl;
$preview = $results->results[0]->previewUrl;
$artwork = $results->results[0]->artworkUrl100;
$icon = $results->results[0]->artworkUrl60;
$type = $results->results[0]->wrapperType;
$desc = $results->results[0]->description;
$name = $results->results[0]->trackName;

$device = $results->results[0]->supportedDevices;
$seller = $results->results[0]->sellerName;
$price = $results->results[0]->price;
$url = $results->results[0]->sellerUrl;
$version = $results->results[0]->version;
$genre = $results->results[0]->primaryGenreName;
$capture = $results->results[0]->screenshotUrls;
$screen = $results->results[0]->ipadScreenshotUrls;

//echo $new_url .$preview. $artwork. $type;
//Affichage

echo '<center>
<table align="center" style="text-align: left; width: 80%; height: 75%;"
 border="0" cellpadding="2" cellspacing="2">
  <tbody>
    <tr valign="top">
      <td style="height: 75px; width: 100px; text-align: center;"><br><img src="'.$icon.'" border="0"></td>
      <td style="height: 75px; width: 100px; text-align: center;">'.$name.'<br>Seller: '.$seller.'<br>Price: '.$price.' euros<br><a href="'.$url.'" target="_blank">Website</a><br>Version: '.$version.'<br>Genre: '.$genre.'</td>
      <td colspan="1" rowspan="2" style="height: 100%;  width: 300px; text-align: justify;"><br><br><br>'.$desc.'</td>
    </tr>
    <tr align="center" valign="top">
      <td style="height: 475px; width: 200px;" colspan="2"
 rowspan="1">
';

//foreach ($capture as $capture) {
//echo '<div class="feature"><img alt="Image Caption" src="'.$capture.'"><div><p>Screenshot</p></div></div>';}
$i = "0";
foreach ($screen as $screen) {
$i++;
$mysock = getimagesize("$screen");
echo '<a href="'.$screen.'" title="Screenshot" class="thickbox" rel="">
<img src="'.$screen.'" alt="Screenshot '.$i.'" '.imageResize($mysock[0], $mysock[1], 300).' border="0" /></a>';
}


echo '
</td>
    </tr>
  </tbody>
</table>';


?>

    </body>
</html>
